package com.shardingdemo.aop;


/**
 * Description: 分库路由值
 */
public class RequestShardValueHolder {
    private static final ThreadLocal<String> CURRENT_SHARD_VALUE = new ThreadLocal<>();

    public static void set(String code) {
        CURRENT_SHARD_VALUE.set(code);
    }

    public static String get() {
        return CURRENT_SHARD_VALUE.get();
    }

    public static void remove() {
        CURRENT_SHARD_VALUE.remove();
    }
}
